<template>
  <DemoCom @hello="showHelloMsg" msg="你好啊！" school="xxx学校">
    <template v-slot:slot1>
      <span>这是一个插槽</span>
    </template>
    <template v-slot:slot2>
      <span>这是一个插槽</span>
    </template>
  </DemoCom>
</template>

<script>
import DemoCom from "@/components/DemoCom.vue";
import {reactive} from "vue";

export default {
  name: 'App',
  components: {
    DemoCom
  },
  setup(){
    let data =reactive({

    })
    function showHelloMsg(value){
      alert(`你好啊，你触发了@hell事件，我收到的参数是：${value}!`)
    }

    return {
      data,
      showHelloMsg
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
